package com.ruicar.afs.cloud.apply.pre.approve.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ruicar.afs.cloud.apply.common.entity.PreApproveInfo;
import com.ruicar.afs.cloud.apply.contract.vo.ContractFileVo;
import com.ruicar.afs.cloud.apply.pre.approve.condition.PreApproveCondition;
import com.ruicar.afs.cloud.apply.pre.loan.condition.ApplyReportCondition;
import com.ruicar.afs.cloud.apply.pre.smallprogram.condition.TencentCloudNuclearBodyCondition;
import com.ruicar.afs.cloud.image.entity.ComAttachmentFile;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

/**
 * 预审批-接口类
 *
 * @author jihuigeng
 */
public interface PreApproveService extends IService<PreApproveInfo> {
    /**
     * 预审批保存
     *
     * @param condition
     * @return
     */
    public Map savePreInfo(PreApproveCondition condition);

    /**
     * 查询和删除附件信息
     *
     * @param id
     * @param type
     * @return
     */
    public String queryAndRemove(String id, String type);

    /**
     * 预审批编辑
     *
     * @param condition
     */
    public Map editPreInfo(PreApproveCondition condition);

    /**
     * 获取二维码组装数据
     *
     * @param id
     * @return
     */
    public Map getQrCode(Long id,String applyNo, String flag);

    /**
     * 根据ID查询预审批信息
     *
     * @param id
     * @return
     */
    PreApproveInfo getById(Long id);

    /**
     * 证件照正反面上传-预审批
     *
     * @param frontIDCard
     * @param reverseIDCard
     * @param params
     * @param custRole
     * @param uploadScene
     */
    void storeCardImage(String frontIDCard, String reverseIDCard, String uploadScene, String custRole, String params);

    /**
     * 证件照正反面上传-预审批
     *
     * @param frontIDCardFile
     * @param reverseIDCardFile
     * @param params
     * @param custRole
     * @param uploadScene
     */
    void storeCardFileImage(MultipartFile frontIDCardFile, MultipartFile reverseIDCardFile, String uploadScene, String custRole, String params);

    /**
     * 获取身份证正反面
     *
     * @param id
     * @return
     */
    Map<String, String> getFileId(String id, String applyNo);

    /**
     * 保存附件信息
     *
     * @param s
     * @param map
     * @param params
     */
    void setImageStore(String s, Map<String, String> map, String params);

    /**
     * 获取微信二维码token
     *
     * @return
     */
    Map getToken();

    /**
     * 获取微信二维码
     *
     * @return
     */
    Map getQrCode();

    /**
     * 获取预审批申请编号
     *
     * @param businessType
     * @param certNo
     * @return
     */
    public String getPreApproveInfoApplyNO(String businessType, String certNo);

    /**
     * 通过申请编号、客户信息、证件号码查询预审批信息
     *
     * @param condition
     * @return
     */
    public PreApproveInfo getPreApproveInfo(PreApproveCondition condition);

    /**
     * 更新人脸识别、三要素、签约结果
     *
     * @param condition
     */
    public PreApproveInfo updatePreApproveInfo(PreApproveCondition condition);

    /**
     * 获取小程序微信二维码
     *
     * @param condition
     * @return
     */
    Map getSmallProgramQrCode(TencentCloudNuclearBodyCondition condition);

    /**
     * 预审批的单子复制到进件
     * @param applyNo
     * @param condition
     */
    public void copyPreInfoToApply(String applyNo, ApplyReportCondition condition);

    /**
     * 保存MD5到file
     */
    public List<ComAttachmentFile> saveOrUpdateFile(List<ContractFileVo> contractFileVos, String params);

}
